"""
URL configuration for Django_study project.

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/5.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.http import HttpResponse
from django.urls import path
# 参数是request 代表请求对象，可以获取请求头信息、请求参数、请求方法等信息
def index(request):
    return HttpResponse("Vue3+Django+Element-ui+ts")
def info(request):
    return HttpResponse("拿取数据")
def class_info(request):
    return HttpResponse("欢迎来到知了课堂")
import book.views

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', index),
    # 不需要加斜杠 因为Django自动在前面已经加上
    path('info/',info),
    path('class/',class_info),
    # book中写了id,name querystring参数
    # http://127.0.0.1:8000/book?id=1&name=凡人修仙传
    path('book/',book.views.book_search_querystring),
#     path传参指定参数类型  默认是字符串
    path('book/<int:book_id>',book.views.book_search_path)
]









